//配置路由的信息
import VueRouter from 'vue-router'
import Vue from 'vue'

const Welcom = ()=>import('../components/Welcom')
const Xiaoxi = ()=>import('../components/Xiaoxi')
const Home= () => import('../views/home/MainHome')
const Register = ()=>import('../components/Register')
const Publich = ()=>import('../components/Publich')
const ForgetPwd = ()=>import('../components/ForgetPwd')
const Profile = ()=>import('../views/profile/MainProfile')
const InfoProfile = ()=>import('../views/profile/InfoProfile')
const PasswordProfile = ()=>import('../views/profile/PasswordProfile')
const Favour = ()=>import('../views/profile/Favour')
const ArticlesList =()=>import('../views/articles/ArticlesList')
const Article =()=>import('../views/articles/Article')
const SearchArticlesList =()=>import('../views/articles/SearchArticlesList')
const Look= () => import('../views/home/btn/Look')
const Biji = ()=>import('../views/home/btn/Biji')

Vue.use(VueRouter)
const routes = [
  {
    path: '',
    redirect: '/welcom'
  },
  {
    path: '/welcom',
    component: Welcom
  },
  {
    path: '/xiaoxi',
    component: Xiaoxi
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/biji',
    component: Biji
  },
  {
    path: '/publich',
    component: Publich
  },
  {
    path: '/fogetpwd',
    component: ForgetPwd
  },
  {
    path: '/profile',
    component: Profile,
    children: [
      {
        path: '/',
        component: Favour
      },
      {
        path: 'Info',
        component: InfoProfile
      },
      {
        path: 'Pwd',
        component: PasswordProfile
      },
      {
        path: 'Favour',
        component: Favour
      }
    ]
  },
  {
    path: '/articleslist/:list_type/:type_id',
    component: ArticlesList
  },
  {
    path: '/article/:aid',
    component: Article,
  },
  {
    path: '/search/:keyword',
    component: SearchArticlesList,
  },
  {
    path: '/look',
    component: Look
  },


]
const router = new VueRouter({
  routes,
  //集成时使用hash，分离时使用history
  // mode: 'hash'
  mode: 'history'
})

export default router
